Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSEARCH-2761 Elasticsearch purges may fail when purging multiple classes of the same inheritance tree in the same transaction #1445

Merged
merged 8 commits into from Jun 8, 2017

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Jun 8, 2017

This PR is based on #1444, which should be merged first.

https://hibernate.atlassian.net//browse/HSEARCH-2761

@Sanne I added non-regression tests. Stricly speaking, only "HSEARCH-2761 Always refresh indexes before performing a delete-by-query" is needed to fix the issue, but the other commits fix hidden issues (discussed in the ticket).

So that order of LuceneWorks for a given class relative to those for
another class is preserved upon successive runs, and is the same from
one machine to another.

This should not change much feature-wise, but should make debugging much
easier in the future.
So that relative order of LuceneWorks for a given class is preserved
upon successive runs, and is the same from one machine to another.

This should not change much feature-wise, but should make debugging much
easier in the future.
Inheritance is already handled at a higher level by creating multiple
purge works.
Rationale: in our case, Elasticsearch is not our source of truth, some
other component (traditionally a database) is. When we perform a
delete-by-query, it's only to do an index purge, and rebuild the index
after that.
If there is a write to the index concurrently to the purge, it's
generally no big deal: it mainly means the document will be reindexed
just a moment later.
This should avoid *some* cases where delete-by-query failed due to a
version conflict: those cases where the update was performed
strictly before the delete-by-query (for instance by the same thread).
@Sanne
Copy link
Member

Sanne commented Jun 8, 2017

Looks very good! Doing some more testing here to understand it better.

One downside: those type related collections are not just conflicting with my PR but I'll need to re-implement some similar approach. The good part is that with the immutable, pre-computed collection I should be able to guarantee a stable order w/o having a performance penalty.

@Sanne Sanne merged commit f62e8ca into hibernate:master Jun 8, 2017
@Sanne
Copy link
Member

Sanne commented Jun 8, 2017

merged 🥇

@yrodiere yrodiere deleted the HSEARCH-2761 branch June 21, 2017 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants